/*
* @Author: chenggh
* @Date: 2025-06-18
* @Link to Problem : https://oj.haizeix.com/problem/235
*/
#include <iostream>
using namespace std;
int arr[10] = {0};
void print_arr(int d){
	for(int i = 0; i <= d; i++){
		if(i) cout << " ";
		cout << arr[i];
	}cout << endl;
}
void f(int i, int j, int d){
	arr[d] = i;
	print_arr(d);
	if(i == j) return;
	f(i + 1, j, d + 1);
	f(i + 1, j, d);
	return;
}
int main(){
	int n; cin >> n;
	f(1, n, 0);
	return 0;
}